package com.order.frontend.order.Entity.Message;

import lombok.Data;

@Data
public class Messages {
    private String messageId;      // 消息唯一标识
    private String senderId;       // 发送者ID
    private String receiverId;     // 接收者ID
    private String content;        // 消息内容
    private Long timestamp;        // 时间戳
    private MessageType type;      // 消息类型 (TEXT, IMAGE, FILE等)
    private Boolean isRead;        // 是否已读
    private String roomId;         // 聊天室ID

    // 构造函数
    public Messages() {}

    public Messages(String senderId, String receiverId, String content, String roomId) {
        this.messageId = java.util.UUID.randomUUID().toString();
        this.senderId = senderId;
        this.receiverId = receiverId;
        this.content = content;
        this.timestamp = System.currentTimeMillis();
        this.type = MessageType.TEXT;
        this.isRead = false;
        this.roomId = roomId;
    }




}
// 消息类型枚举
enum MessageType {
    TEXT,    // 文本消息
    IMAGE,   // 图片消息
    FILE,    // 文件消息
    EMOJI    // 表情消息
}